#include "adler32.h"

#define MOD_ADLER 65521U

uint32_t MakeAdler32(uint8_t *inData, size_t length)
{
    uint32_t a = 1U;
    uint32_t b = 0U;

    while (length-- > 0) {
        a = (a + *inData++) % MOD_ADLER;
        b = (b + a) % MOD_ADLER;
    }

    return (b << 16) | a;
}

